package com.hzcc.hzccblog.common.enums;

import com.hzcc.hzccblog.common.Result;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author 早睡蛋
 * @Date 2022/7/15 20:19:46
 * @Desc:登录注册枚举类
 */
@Getter
@AllArgsConstructor
public enum LoginEnums {

    LOGIN_ERROR(400,"登录出错"),

    LOGIN_OK(200,"登录成功"),
    LOGIN_FAIL(400,"账号或密码错误"),
    EMAIL_FAIL(400,"账号错误"),
    PWD_FAIL(400,"密码错误"),

    MSM_SEND(200,"验证码已发送"),
    MSM_NULL(400,"验证码无效"),
    MSM_FAIL(200,"验证码错误"),
    MSM_EXIST(400,"请勿重复发送"),

    EMAIL_REX(400,"邮箱格式错误"),
    EMAIL_EXIST(400,"邮箱已被注册"),

    REGISTER_OK(200,"注册成功"),
    REGISTER_FAIL(400,"注册失败"),

    PLEASE_LOGIN(400,"请先登录"),


    ;

    LoginEnums(int code, String message) {
        this.result =  Result.defaultResultResponse();
        result.setCode(code);
        result.setMessage(message);
    }

    public int getCode(){
        return result.getCode();
    }

    public String getMessage(){
        return result.getMessage();
    }

    public Result getResult() {
        return result;
    }


    private final Result result;
}
